package com.jeffse.light.stream.app.dataSource;

import com.jeffse.light.stream.core.data.context.SourceContext;
import com.jeffse.light.stream.core.function.base.AbstractSourceFunction;

public class CustomDataSource implements AbstractSourceFunction<String> {
    private Boolean isRunning = true;

    @Override
    public void run(SourceContext<String> ctx) throws Exception {
        while(isRunning){
            Thread.sleep(3000);
            ctx.collect("111_222");
        }
    }

    @Override
    public void cancel() {
        isRunning = false;
    }
}
